//
// Created by xili on 2024/9/10 16:56.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class Solution {
public:
    vector<long long> maximumEvenSplit(long long finalSum) {
        vector<long long> ans;
        if (finalSum & 1) {
            return ans;
        }
        int i = 1;
        long long left = 0;
        while (finalSum) {
            if (i * 2 * 2 > finalSum) {
                ans.push_back(i * 2);
                finalSum -= i * 2;
                i++;
            } else {
                ans.push_back(finalSum);
                finalSum = 0;
            }
        }
        return ans;
    }
};